package com.steward.controller.card;

import com.steward.commons.Result;
import com.steward.dto.card.OrderDTO;
import com.steward.server.card.CardService;
import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 用户年卡查询
 * 
 * @author mastercheng
 * @since 2017-03-07 20:43:53
 */
@RestController
public class OilCardController {

	private static Logger logger = Logger.getLogger(OilCardController.class);

	@Resource
	private CardService cardService;

	/**
	 * 查询年卡信息
	 * 
	 * @param orderId
	 * @return
	 */
	@GetMapping("/users/ver1/OilCardVerify/{orderId}")
	public @ResponseBody Result<Double> UserYearCardController(@PathVariable("orderId") String orderId) {
		return cardService.queryOilCardRate(orderId) ;
	}

	@GetMapping("/main/ver1/createOilPayOrder/{UserID}/{OilCardID}/{payAmt}/{payType}")
	public @ResponseBody Result<OrderDTO> createOilPayOrder(@PathVariable("UserID") String UserID ,
															@PathVariable("OilCardID") String OilCardID,
															@PathVariable("payAmt") double pay_amt,
															@PathVariable("payType") int payType){
		return cardService.createOilPayOrder(UserID, OilCardID, pay_amt, payType) ;
	}

	@GetMapping("/users/ver1/OilCardPayCallBackWxPay/{orderId}/{createTime}")
	public @ResponseBody Result<Object> oilCardPayCallBackWxPay(@PathVariable("orderId") String orderId ,
														  @PathVariable("createTime") String createTime){
		return null ;
	}


	




}
